home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
BASIC
/
2620E.ZIP
/
TODAY.ZIP
/
TODAYU.BAS
< prev
next >
Wrap
BASIC Source File
|
1990-02-19
|
2KB
|
73 lines
$compile UNIT
'(C) 1987-90 Barry Erick
' Other than this being a UNIT, there are no differences from the
' TB version
'any External MUST be made PUBLIC in the Main unit, even if not used
'Always let the user know what the variables are if the unit is supplied
'without a demo main
EXTERNAL wk$,dm$,month$,year$
SUB GetTodaysdate PUBLIC 'make it accessable to the main
local wkdy%,Dat%,Mont%,yea%
REG 1,&H2A00
CALL INTERRUPT &H21
wkdy%= REG(1) MOD 256 'AH
Dat% = REG(4) MOD 256 'DH
Mont%= REG(4)\256 'DL
yea% = REG(3) 'CX
SELECT CASE wkdy%
CASE 0
WK$ = "Sunday"
CASE 1
WK$ = "Monday"
CASE 2
WK$ = "Tuesday"
CASE 3
WK$ = "Wednesday"
CASE 4
WK$ = "Thursday"
CASE 5
WK$ = "Friday"
CASE 6
WK$ = "Saturday"
END SELECT
SELECT CASE dat%
CASE 1,21,31
Dm$ = STR$(dat%)+"st"
CASE 3,23
Dm$ = STR$(dat%)+"rd"
CASE 2,22
Dm$ = STR$(dat%)+"nd"
CASE ELSE
Dm$ = STR$(dat%)+"th"
END SELECT
SELECT CASE Mont%
CASE 1
Month$ = "January"
CASE 2
Month$ = "February"
CASE 3
Month$ = "March"
CASE 4
Month$ = "April"
CASE 5
Month$ = "May"
CASE 6
Month$ = "June"
CASE 7
Month$ = "July"
CASE 8
Month$ = "August"
CASE 9
Month$ = "September"
CASE 10
Month$ = "October"
CASE 11
Month$ = "November"
CASE 12
Month$ = "December"
END SELECT
Year$ = RIGHT$(STR$(yea%),4)
END SUB